package net.wsfcp.android.utils;

import net.wsfcp.commons.security.RSACoder;


//加密
public class EncryptUtils {
    public static String encryptByPublicKey(String data, String publicKey) {

        try {
            return RSACoder.getInstance().encryptByPublicKey(data, publicKey);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }

    public static String getEncryptPassword(String data) {
        String pwd = "";
        try {
            pwd = RSACoder.getInstance().encryptByPublicKey(data, SpUtils.getInstance().getPublicKey());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return pwd;
    }
}
